import set from '@dfeidao/atom-web/local/set';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import set_nodes_cls from '@dfeidao/atom-web/ui/set-nodes-cls';
import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';

export default async function a003(fd: IFeidaoAiBrowserComponent, args: { currentTarget: HTMLElement }) {
	const node = args.currentTarget.closest('[dlist1]') as HTMLDivElement;
	const nodes = Array.from(fd.data.node.querySelectorAll('[dlist1]')) as HTMLElement[];
	set_nodes_cls(nodes, 'bg-c', false);
	set_node_cls(node, 'bg-c', true);
	const pk_val = node.getAttribute('data-feidao-no');
	const search_field_val = node.getAttribute('data-feidao-name');
	set(fd, 'pk_val', pk_val);
	set(fd, 'search_field_val', search_field_val);
	// debugger
}
